package com.insight.parse;
	
	import java.net.*;
	import java.io.*;

	public class URLConnectionReader {
	    
	    public static void saveUrlToFile(String url, String fileName) throws Exception {
	        URL oracle = new URL(url);
	        URLConnection yc = oracle.openConnection();
	        BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream()));
	        BufferedWriter out = new BufferedWriter(new FileWriter(fileName));

	        String inputLine;
	        while ((inputLine = in.readLine()) != null) 
	        	out.write(inputLine);
	        in.close();
	        out.close();
	    }
	    
		public static void main(String[] args) throws Exception {
			 URLConnectionReader.saveUrlToFile("http://www.google.com","c:/salesinsight/t.txt");
	    }
	
}
